PDMENU

Section: User Commands (1)
Updated:
Index Return to Main Contents
 

NAME

pdmenu - simple menu program  

SYNOPSIS

pdmenu [menufile ...]  

DESCRIPTION

Pdmenu is a simple menu program for Linux that uses the dialog program to display a menu from which the user can run programs. Submenus are supported.

In pdmenu, you will be presented with a menu of commands. Simply use the arrow keys to move to the command you want to run, and press Enter to run the program. When the program ends, you will be returned to the menu.

Some menu items are actually submenus, and will take you to another menu. To leave a submenu, press Tab to select the ``cancel'' button, and then hit enter. The same applies to leaving the main menu. See the dialog(1) manpage for more information on using the dialogs.  

SYNTAX

When pdmenu starts up, it looks for a pdmenurc file that defines the menus it will display. It looks in the following locations:
In the menufiles specified on the command line. If you specify multiple menufiles, pdmenu will merge them all into one set of menus. Menu definitions in later menufiles will override menu definitions with the same name in earlier menufiles.

In ~/.pdmenurc

In /etc/pdmenurc

It will use the first menu file it finds, and ignore all others.

Here is a sample pdmenurc:

                        
        
        #this is a comment
        menu:main:blue-scheme:Main Menu:Things to do at foobar
                show:g:Games:games
                exec::Mail:pine
                exec::News:slrn:c
                exec::WWW:lynx
                exec::Irc:irc:c
                exec:exec::Talk:ytalk %Talk%Enter username to talk to.%:i
        
        menu:games::Games:Some text-based games
                exec::Tetris for Terminals:/usr/games/tt
                exec::Adventure:/usr/games/adventure:c
                exec::Zork:/usr/games/zork:c


This will display a menu, with a submenu for games.

Pdmenu doesn't care how its pdmenurc is indented; all whitespace is ignored. However, each keyword must be on its own lone. Currently, there are 3 keywords:

menu
This starts a menu. All items between this menu keyword and the next will be in one menu. The syntax is:

menu:menuname:colordef:title:text

Menuname is the name of the menu (each menu must have a unique name). Colordef is the name of a file that defines the colors used in this menu. The default location of colordef files is /usr/local/lib/pdmenu/. Colordef files are actually dialog configuration files. See the dialog(1) manpage for information about these files. Title is the title of the menu, and text is some text that is displayed under the title, describing the menu.

A menu named ``main'' must exist, it is always displayed as the first menu.

show
This displays a submenu. The syntax is:

show:hotkey:desc:menuname

Menuname is the name of the menu to show, corresponding to the menuname in the menu's definition. Desc is the description of the submenu to appear in the parent window. Hotkey is an optional character that lets the user quickly select this menu by typing in the character.

exec
This runs a command. The syntax is:

exec:hotkey:desc:command:flags

Command is the actual command to run when this item is selected. Hotkey is an optional character that lets the user quickly select this item by typing in the character. Desc is the description of the command that appears in the menu. The flags are a collection of characters from the list below. They are optional.

Valid flags are:

c
clear screen before running the command
p
pause after the command exits
i
in the command to be run, replace %string1%string2% with the result of popping up a dialog with title string1 and description string2. For an example of this, see the last exec command in the main menu of the example above, which will pop up a dialog asking for the name of the user they want to talk to, and run ytalk with that username.
 

AUTHOR

Pdmenu was written by Joey Hess jeh22@cornell.edu.  

DISTRIBUTION

Redistribution is subject to the GNU public license.  

BUGS

YOU tell me.


 

Index

NAME
SYNOPSIS
DESCRIPTION
SYNTAX
AUTHOR
DISTRIBUTION
BUGS

This document was created by man2html, using the manual pages.
Time: 15:53:32 GMT, November 05, 2024